package models.states;

import java.util.TreeMap;

import models.common.ActorStateVariable;
import xml.Xml;

public class ActorState extends TreeMap<ActorStateVariable, String> implements State {

	/**
	 * serialization id
	 */
	private static final long serialVersionUID = 1L;

	public ActorState() {
		for(ActorStateVariable v : ActorStateVariable.values()) {
			this.put(v,"");
		}
	}

	@Override
	public void fromXml(String xml) {
		for(ActorStateVariable v : ActorStateVariable.values()) {
			this.put(v, Xml.getTag(v.toString(), xml));
		}
	}

	@Override
	public String toXml(String tag) {
		String output = "";
		for(ActorStateVariable v : ActorStateVariable.values()) {
			output += Xml.write(v.toString(),this.get(v));
		}
		return Xml.write(tag, output);
	}

}
